{extend name="apps/common/view/front.tpl" /}
<!-- -->
{block name="header_meta"}
<title>{:lang('user_register_index_title')}－{:config('common.site_name')}</title>
<meta name="keywords" content="{:lang('user_register_index_keywords')}" />
<meta name="description" content="{:lang('user_register_index_description')}" />{/block}
{block name="header_more"}<link href="{:DcUrlCss($domain, $path_root.$path_view.'column.css')}" rel="stylesheet">{/block}
{block name="main"}
<div class="d-flex flex-column justify-content-center h-100">
  <a class="h3 text-light text-decoration-none mx-auto mb-4" href="{$path_root}">{:config('common.site_name')}</a>
  <div class="card mx-auto">
    <div class="card-header text-center pt-3">
      <a class="small text-muted mr-3" href="{:DcUrl('user/login/index')}"><i class="fa fa-fw fa-key"></i>密码登录</a>
      {if userCaptchaLogin()}<a class="small text-muted mr-3" href="{:DcUrl('user/account/index')}"><i class="fa fa-fw fa-sign-in"></i>验证码登录</a>{/if}
      <a class="small text-purple" href="javascript:;"><i class="fa fa-fw fa-sign-in"></i>注册帐号</a>
    </div>
    <form class="card-body" action="{:DcUrl('user/register/save')}" method="post" target="_self" data-toggle="form" data-callback="daicuo.user.dialog">
    <input type="hidden" name="callback" value="{$callback}">
    <input type="hidden" name="state" value="{$state}">
    {if config('user.register_name')}
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
      </div>
      <input type="text" class="form-control" name="user_name" value="" required="true" placeholder="{:lang('user_name')}" maxlength="30">
    </div>
    {/if}
    {if config('user.register_email')}
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-email">@</i></span>
      </div>
      <input type="email" class="form-control" name="user_email" value="" required="true" placeholder="{:lang('user_email')}" maxlength="60">
    </div>
    {/if}
    {if config('user.register_mobile')}
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-mobile"></i></span>
      </div>
      <input type="text" class="form-control" name="user_mobile" value="" required="true" placeholder="{:lang('user_mobile')}" maxlength="11">
    </div>
    {/if}
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
      </div>
      <input type="password" class="form-control" name="user_pass" value="" required="true" placeholder="{:lang('user_pass')}">
    </div>
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
      </div>
      <input type="password" class="form-control" name="user_pass_confirm" value="" required="true" placeholder="{:lang('user_pass_confirm')}">
    </div>
    {if DcBool(config('common.site_captcha'))}
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text"><i class="fa fa-fw fa-image"></i></span>
      </div>
      <input type="text" class="form-control" name="user_captcha" required="true" placeholder="验证码" autocomplete="off">
    </div>
    <p class="mb-3">
      <img class="rounded img-fluid border w-100" id="captcha" src="{$path_root}index.php?s=captcha" alt="图形验证码" data-toggle="captcha"/>
    </p>
    {/if}
    <p class="text-center mb-0">
      <button class="btn btn-purple btn-block" type="submit">{:lang('signUp')}</button>
     </p>
    </form>
   {if config('user.oauths')}
    <div class="card-footer text-center small">
      {foreach name=":explode(',',config('user.oauths'))" id="login"}
      <a href="{:DcUrl($login)}">{:lang($login)}</a>
      {/foreach}
    </div>
    {/if}
  </div>
</div>
{/block}